package com.atguigu.spzx.product.service;

import com.atguigu.spzx.model.dto.h5.ProductSkuDto;
import com.atguigu.spzx.model.dto.product.SkuSaleDto;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.h5.ProductItemVo;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * ClassName: ProductService
 * Package: com.atguigu.spzx.product.service
 * Description:
 *
 * @Author 刘强
 * @Create 2024/7/14 23:33
 * @Version 1.0
 */
public interface ProductService {
    /**
     * 分页带条件查询商品sku
     * @param page
     * @param limit
     * @param productSkuDto
     * @return
     */
    PageInfo<ProductSku> findByPage(Integer page, Integer limit, ProductSkuDto productSkuDto);

    /**
     * 根据skuId查询商品详情
     * @param skuId
     * @return
     */
    ProductItemVo item(Long skuId);

    /**
     * 根据skuId获取sku
     * @param skuId
     * @return
     */
    ProductSku getBySkuId(Long skuId);

    /**
     *  跟新库存和销量 -> 库存减少，销量增加
     * @param skuSaleDtoList
     */
    void updateStockAndSaleNum(List<SkuSaleDto> skuSaleDtoList);
}
